#include "rpc_server.h"
#include "rpcGloableTables.h"
#include "sysInfo.h"
#include "rpc_sysInfo.h"

int RPCGetSysInfo(unsigned char *request,unsigned char *result,int *return_param_num,int *return_bytes)
{
	int cpu_num;
	int offset2 = sizeof(RPC_HEAD_SERV_ST);
	int pkt_len=0,offset=0;

	/* call real function */
	cpu_num = _RPCGetSysInfo();
	cc_rpc_generate_param(result, &offset, &pkt_len, TypeServI32, 4 + sizeof(cpu_num), (unsigned char *)&cpu_num);
	*return_param_num = 1;
	*return_bytes += pkt_len;
	return 0;
}
#if 1
int RPCGetSysInfo_IP(unsigned char *request,unsigned char *result,int *return_param_num,int *return_bytes)
{
	int ip;
	int offset2 = sizeof(RPC_HEAD_SERV_ST);
	int pkt_len=0,offset=0;

	/* call real function */
	ip = _RPCGetSysInfo_IP();
	cc_rpc_generate_param(result, &offset, &pkt_len, TypeServU32, 4 + sizeof(ip), (unsigned char *)&ip);
	*return_param_num = 1;
	*return_bytes += pkt_len;
	return 0;
}
#endif
void rpcStatSysInfoInit(void)
{
	int ifor;
	for(ifor =0;ifor<100;ifor++)
	pRpcGetSysInfo[ifor] = NULL;
	pRpcGetSysInfo[0] = RPCGetSysInfo;
	pRpcGetSysInfo[1] = RPCGetSysInfo_IP;
	pRpcGetSysInfo[2] = NULL;
	pRpcGetSysInfo[3] = NULL;
	pRpcGetSysInfo[4] = NULL;
	pRpcGetSysInfo[5] = NULL;
	pRpcGetSysInfo[6] = NULL;
	pRpcGetSysInfo[7] = NULL;
	//add more
}

